# 可以存储不同类型，但是实际工作中尽量用同种类型
name_list = ['zhangsan', 'lisi', '王五']
print(name_list)
print(name_list[2])
print(name_list.index('lisi'))
print(name_list.count('lisi'))
print(len(name_list))
print('lisi' in name_list)
print('lisiw' in name_list)
print('lisidd' not in name_list)

name_list.append("赵六")
print(name_list)
name_list.extend(['小红', '哈哈'])
print(name_list)
name_list.insert(1, '小明')
print(name_list)
name_list.remove('lisi')
print(name_list)

# 遍历
i = 0
while i < len(name_list):
    print(name_list[i])
    i += 1

for i in name_list:
    print(i)

